<cfcomponent extends="org.cfcunit.framework.TestCase">

<cffunction name="dumpvar">
  <cfargument name="var" default="blank">
  <cfargument name="abort" default="true">
  <cftry>
	  <cfdump var="#var#">
	<cfcatch>
	  <cfset writeoutput(cfcatch.Message & " " & cfcatch.Detail & " " & cfcatch.TagContext[1].line & " " & cfcatch.stacktrace) />
	</cfcatch>
	</cftry>
	<cfif arguments.abort>
	  <cfabort />
	</cfif>
</cffunction>



  <cffunction name="setUp" returntype="void" access="public">
		<cfscript>
			//var genSchema = variables.hibernatefactory.createHsqldbSchema();
			var params = structNew();
			var thisdir = GetDirectoryFromPath(getMetaData(this).path);
			variables.hbmsLocation = thisdir & "hbm/";
			variables.hbmsJarLocation = thisdir & "src/cfhibernate.jar";
			variables.srcLocation = thisdir & "src/";
			params["hibernate.dialect"] = "org.hibernate.dialect.HSQLDialect";
      params["hibernate.connection.driver_class"] = "org.hsqldb.jdbcDriver";
      params["hibernate.connection.url"] = "jdbc:hsqldb:mem:coldshendb";
      params["hibernate.connection.username"] = "sa";
      params["hibernate.connection.password"] = "";
      params["hibernate.connection.pool_size"] = "1";
      params["hibernate.connection.autocommit"] = "true";
      params["hibernate.cache.provider_class"] = "org.hibernate.cache.HashtableCacheProvider";
      params["hibernate.hbm2ddl.auto"] = "create-drop";
//      params["hibernate.default_schema"] = "coldshen";
      params["hibernate.show_sql"] = "true";
		</cfscript>
		<cfset coldSpring = createObject( 'component', 'coldspring.beans.DefaultXmlBeanFactory').init() />
		<cfset coldSpring.loadBeansFromXmlFile("/actionpacks/cfhibernate/tests/config/cs/cfhibernate.cs.xml") />
    <cfset variables.hibernatefactory = coldSpring.getBean('hibernateService') />
   	<cftry>
			<!---
			<cfset variables.hibConfig = variables.hibernatefactory.getConfiguration(params,variables.hbmsLocation) />
			--->
			<cfset variables.hibConfig = variables.hibernatefactory.getConfiguration(params) />
	   	<cfcatch><cfoutput>#cfcatch.message#</cfoutput><cfabort></cfcatch>
		</cftry>
  </cffunction>
				
</cfcomponent>